/**
 * 
 */
package org.cuatrovientos.javakart;

import java.util.Random;

/**
 * @author PC
 *
 */
public class Vehicle {

	protected String name;
	protected int speed = 0;
	protected String acceleration;
	protected int grip = 0;
	/**
	 * 
	 */
	public Vehicle(String name) {
		this.name = name;
		name = "";
	}
	/**
	 * @return the name
	 */
	protected String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	protected void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the speed
	 */
	protected int getSpeed() {
		return speed;
	}
	/**
	 * @param speed the speed to set
	 */
	protected void setSpeed(int speed) {
		this.speed = speed;
	}
	/**
	 * @return the acceleration
	 */
	protected String getAcceleration() {
		return acceleration;
	}
	/**
	 * @param acceleration the acceleration to set
	 */
	protected void setAcceleration(String acceleration) {
		this.acceleration = acceleration;
	}
	/**
	 * @return the grip
	 */
	protected int getGrip() {
		return grip;
	}
	/**
	 * @param grip the grip to set
	 */
	protected void setGrip(int grip) {
		this.grip = grip;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Vehicle [name=" + name + ", speed=" + speed + ", acceleration="
				+ acceleration + ", grip=" + grip + "]";
	}
	/**
	 * initialize vehicle values
	 */
	
	private void initialize () {
		Random random = new Random();
		for (int i = 0;grip + speed != 18;i++){
		grip = random.nextInt(17);
		speed = random.nextInt(17);
		}
		
	}
	public int move() {
		Random random = new Random();
		return speed + grip + random.nextInt(6);
	}
	public int maneuvre() {
		Random random = new Random();
		return grip + random.nextInt(6);
	}

}
